
////#include "err_code_mk.h"


#ifndef err_code_mk_h
#define err_code_mk_h

//#define ERR_CODE_START  1000


#define SPEC_OUT_CODE     32768    //  大于此值表示特定的返回数据
/******************************************************* 
err_code   注意， 新增错误码， 只能在最后新增， 不可中间插入！！！！
  因为 const char *err_code_msg[]   要与此表对应。
*********************************************************/
enum {
	NO_ERR = 0,  // 0, 1 都表示成功
	OK_KT1 = 1,
	ERR_MK = 2, // 2开始为失败	 
	NOT_LOGIN,
	NO_DEVICE,
	GROUP_NUM_OVERFLOW,
	ATTR_BUF_SMALL,
	NONE_GROUP_NAME,
	DEV_OR_GROUP_ADDR_ERR,
	DEVICE_TYPE_NOT_SUPPORT,
	SCENCE_NAME_ERR,
	SCENE_FULL = 11,
	DEVICE_NAME_ERR,
	BIND_NUM_OVER_FLOW,
	PID_ERR,
	FORMAT_ERR,
	NOT_SUPPORT = 16,
	WHITELIST_FULL,
	AUTOREG_POOL_FULL,
	PLC_UART_QUEUE_ERR,
	PLC_FRAME_HEAD_ERR,
	AUTO_ADD_ALL_WHITELIST = 21,
	CCO_RSP_TIMEOUT,
	STA_RSP_TIMEOUT,
	WAIT_NEXT_PKG,
	MUST_DEL_ALL_SCENE_FIRST,
	MUST_DEL_SCENES_WITH_THIS_DEVICE_FIRST = 26,
	DEVICE_SCENE_SYNC_FAIL,
	SYNC_LEVEL_ERR,
	METER_BREAKER_NOT_EXIST,
	OPEN_WHITELIST_ERR,
	READ_PID_ERR = 31,
	CMD_NO_SUPPORT,
	MSG_ID_NOT_MATCH,
	TIMERING_TASK_NUM_OVERFOLW,
	TIMERING_TASK_ID_ERR,
	FW_SIZE_TOO_LARGE = 36,
	CHKSUM_ERR,
	TRANSMIT_FW_TO_NODE_ERR,   //  传输到节点的ota数据错误
	RSP_BUF_TOO_SMALL,
	NODE_OFFLINE = 40,
	DOWNLOAD_FAIL,
	PLC_BUSY,
	RS485_BUSY,
	OTA_FW_NOT_MATCH_DEVICE_TYPE,  // 新增错误码， 只能在最后新增， 不可中间插入！！！
	
	SOME_PARAM_SET_ERR,  // 45
 	DEVICE_TIMING_TASK_NUM_OVERFOLW,
	READ_BK_STATUS_ERR,
	CTRL_BK_FAIL,
	NO_USB_DRV_FOR_GSM,  //  没有gsm usb 串口驱动
	
	REG_ADDR_RANGE_OUT,  //  50 寄存器地址超范围
	CLEAR_CCO_OTA_BUF_ERR,   //  清除cco ota 下装错误
	TX_GW2CCO_BUF_ERR,      // 传输到cco 的ota 文件错误
	TX_GW2CCO_BUF_ERR2,		// 传输到cco 的ota 文件错误
	SCENE_EXEC_BUSY,      // 场景忙，还有正在执行的场景
	
	SCENE_NOT_FOUND,   // 55
	FILE_TRANS_BUSY,
	FILE_SIZE_TOO_BIG,
	FILE_NOT_FOUND,
	SCENE_SYNC_BUSY,   
	
	DPID_NOT_MATCH,   // 60
	DATA_TYPE_NOT_MACTH,
	ATTR_NOT_EQUAL,
	
};

const char *get_err_msg(unsigned int err_code);


#endif











